/*!  \file  BiReduction.h
 *	  \brief  
 * 
 *   \details   details
 *   \author    Yordan Madzhunkov German Research School for Simulation Sciences GmbH
 *   \version   1.0
 *   \date      09/19/2013 02:10:05 PM
 *   \copyright GNU Public License.
 */
#pragma once
class Matrix;
class BiReduction : public Implementation {
public: 
	BiReduction(const char * name_);
	// The matrix A is reduced to bi diagonal form
	// A = U1 * B * V1^T
	// U1, V1^T are orthogonal matrices
	// B is a Bidiagonal Matrix
	virtual void compute( Matrix & A, Matrix & U1, Matrix & B, Matrix & V1T ) = 0;
};

class BiReductionUnitTest : public UnitTest { 
public: 
	BiReductionUnitTest ( BiReduction &); 
	virtual ~BiReductionUnitTest (){}; 
	virtual bool test() const; 
private:
	DISALLOW_COPY_AND_ASSIGN(BiReductionUnitTest);
	bool test1(const int m, const int n, bool transA, const double limit) const;
	BiReduction & reduct;
};

#define BIREDUCT(x) \
class x : public BiReduction {\
public: \
	x();\
	virtual ~x(){};\
	virtual void compute(Matrix & A, Matrix & U1, Matrix & B, \
	Matrix & V1T );\
	virtual bool setNumberOfThreads(int nThreads_);\
};
